Leadtools.Barcode Namespace > BarcodeReader Class > ReadBarcodes Method : ReadBarcodes(RasterImage,LeadRect,Int32,BarcodeSymbology[]) Method |
For information about this method please see ReadBarcodes(RasterImage,LogicalRectangle,Int32,BarcodeSymbology[]).
public BarcodeData[] ReadBarcodes( RasterImage image, LeadRect searchBounds, int maximumBarcodes, BarcodeSymbology[] symbologies )
'Declaration Public Overloads Function ReadBarcodes( _ ByVal image As RasterImage, _ ByVal searchBounds As LeadRect, _ ByVal maximumBarcodes As Integer, _ ByVal symbologies() As BarcodeSymbology _ ) As BarcodeData()
'Usage Dim instance As BarcodeReader Dim image As RasterImage Dim searchBounds As LeadRect Dim maximumBarcodes As Integer Dim symbologies() As BarcodeSymbology Dim value() As BarcodeData value = instance.ReadBarcodes(image, searchBounds, maximumBarcodes, symbologies)
public BarcodeData[] ReadBarcodes( RasterImage image, LeadRect searchBounds, int maximumBarcodes, BarcodeSymbology[] symbologies )
ObjectiveC Syntax
function Leadtools.Barcode.BarcodeReader.ReadBarcodes(RasterImage,LeadRect,Int32,BarcodeSymbology[])( image , searchBounds , maximumBarcodes , symbologies )
public: array<BarcodeData^>^ ReadBarcodes( RasterImage^ image, LeadRect searchBounds, int maximumBarcodes, array<BarcodeSymbology>^ symbologies )
Note: In LEADTOOLS for .NET, the equivalent to Leadtools.LeadRect is Leadtools.Forms.LogicalRectangle.
[TestMethod] public async Task BarcodeReader_ReadBarcodeExample5() { string imageFileName = @"Assets\Barcode2.tif"; // Create a Barcode engine BarcodeEngine engine = new BarcodeEngine(); // Get the Barcode reader instance BarcodeReader reader = engine.Reader; using(RasterCodecs codecs = new RasterCodecs()) { StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(imageFileName); using(RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile))) { // We are interested in QR and Datamatrix barcodes only BarcodeSymbology[] symbologies = { BarcodeSymbology.QR, BarcodeSymbology.Datamatrix }; // Tead the barcodes Debug.WriteLine("Reading only QR and Datamatrix barcodes"); BarcodeData[] barcodes = reader.ReadBarcodes(image, LeadRectHelper.Empty, 0, symbologies); if (barcodes == null) { Debug.WriteLine("No barcodes found"); return; } // Show the location and data if found for each barcode foreach(BarcodeData barcode in barcodes) { // This will find the barcode and print its information now Debug.WriteLine("Found a {0} barcode at {1}, data:\n{2}", barcode.Symbology, barcode.Bounds, barcode.Value); } } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2